<script type="text/javascript">
//<![CDATA[
function goto_submit()
{
	//1. 제목 체크
	var title = $.trim($("input[name=eb_subject]").val());
	if(title.length < 1)
	{
		alert("제목을 입력하세요.");
		$("input[name=eb_subject]").val("");
		$("input[name=eb_subject]").focus();
		return false;
	}

	//2. 작성인 체크
	var name = $.trim($("input[name=eb_name]").val());
	if(name.length < 1)
	{
		alert("작성인을 입력하세요.");
		$("input[name=eb_name]").val("");
		$("input[name=eb_name]").focus();
		return false;
	}


	//3. 비밀번호 체크
	<?php if (!$User->is_login()) { ?>
	var txt = $.trim($("input[name=eb_pw]").val());
	if(txt.length < 1)
	{
		alert("비밀번호를 입력하세요.");
		$("textarea[name=eb_pw]").val("");
		$("textarea[name=eb_pw]").focus();
		return false;
	}
	<?php } ?>

	//3. 내용 체크
	var txt = $.trim($("textarea[name=eb_txt]").val());
	if(txt.length < 1)
	{
		alert("내용을 입력하세요.");
		$("textarea[name=eb_txt]").val("");
		$("textarea[name=eb_txt]").focus();
		return false;
	}

	return true;
}

function go_list()
{
	document.location.href = "<?=$_SERVER['PHP_SELF']?>?mid=<?=$mid?>";
}
//]]>
</script>

<section id="subPageContent">
<header class="subNavi">
		<h1 class="subtle"><img src="../images/sub/tle_<?=$ebcf_id?>.gif" alt="AMnote자료실"></h1>
		<h2 class="slogan"><img src="../images/sub/product01.gif" alt="외국계기업에 최적화된 중소기업통합 경영관리 프로그램"></h2>
		<div id="subNav"><p class="top_img"><img src="../images/sub/buy01.gif" alt=""></p></div>

</header>
<div class="lay_board">
<div style="padding:30px">
	<form name="board_insert_form1" id="board_insert_form" method='post' action="<?=$EzbbsManager->get_url_root()?>/index.php" target="form_receiver" enctype="multipart/form-data" onsubmit="return goto_submit();">
	<table class="board_write" border="1" cellspacing="0" cellpadding="0">
		<caption>
			글쓰기페이지
		</caption>
		<tr>
		<th scope="row">
			<label for="title">제목</label>
		</th>
			<td>
				<input name="eb_subject" id="title" class="write_form01" type="text" value="<?=$current_record['eb_subject']?>" title="제목을 입력해주세요" />
			</td>
		</tr>
		<tr>
		<th scope="row">
			<label for="name">작성자</label>
		</th>
			<td>
				<input name="eb_name" id="name" class="write_form02" type="text" value="<?=$current_record['eb_name']?>" title="작성자를 입력해주세요" />
			</td>
		</tr>
		<?php if (!$User->is_login()) { ?>
		<tr>
			<th scope="row">
				<label for="name">비밀번호</label>
			</th>
			<td><input type="password" name="eb_pw" size="16" maxlength="16"  class="write_form01"title="비밀번호를 입력해주세요." class="required" /></td>
		</tr>
		<?php } ?>
		<tr>
			<th scope="row">
				<label for="email">이메일</label>
			</th>
			<td>
				<input name="eb_eml" id="email" class="write_form01" type="text" value="<?=$current_record['eb_eml']?>" title="이메일을 입력해주세요" />
			</td>
		</tr>
		<?php if ($_set['file_num']) { ?>
		<?php if (count($current_file_list)) { ?>
		<?php foreach ($current_file_list as $k => $v) { ?>
		<tr>
			<th scope="row">첨부파일</th>
			<td>
				<?=$v['ebfi_pname']?> (<?=$v['size']?>) <input type="button" value="<?=$_lang['file_del']?>" style="border:1px solid #888;font-size:12px;padding:2px;" onclick="goto_ezbbs_file_delete(<?=$v['ebfi_ebseq']?>, <?=$v['ebfi_no']?>); return false;" />
			</td>
		</tr>
		<?php } ?>
		<?php } ?>
		<?php if (count($current_file_list) < $_set['file_num']) { ?>
		<?php for ($i=count($current_file_list), $size=$_set['file_num']; $i<$size; $i++) { ?>
		<tr>
			<th scope="row">첨부파일</th>
			<td>
				<input name="upload_file_<?=$i?>" class="write_form01" type="file" value="" title="첨부파일<?=$i?>을 입력하세요." />
			</td>
		</tr>
		<?php } ?>
		<?php } ?>
		<?php } ?>
		<tr>
			<th scope="row">
				<label for="nere_txt">내용</label>
			</th>
			<td class="textarea_text">
				<p>
					<label for="html_flag" class="cla_label_left">HTML적용</label>
					<input type='checkbox' name='eb_html_flag' id='html_flag' value='1' <?php if($current_record['eb_html_flag'] == "1") { ?>checked="checked"<?php } ?> />
					<label for="br_flag" class="cla_label_left">자동개행</label>
					<input type='checkbox' name='eb_br_flag' id='br_flag' value='1' <?php if($current_record['eb_br_flag'] == "1") { ?>checked="checked"<?php } ?> />
				</p>
				<textarea name="eb_txt" id="nere_txt" cols="91" rows="15" title="내용을 입력해주세요" class="required"><?=strip_tags($current_record['eb_txt'])?></textarea>
			</td>
		</tr>
	</table>


	<div class="board_detail_btn">
		<ul class="btn01">
			<li>
				<span><input type="image" src="/images/board/confirm_btn.gif" alt="확인" /></span>
				<span><a href="/" onclick="history.back(); return false;"><img src="/images/board/cancel_btn.gif" alt="취소" /></a></span>
			</li>
		</ul>
	</div>


	<input type="hidden" name="job" value="update" />
	<input type="hidden" name="subjob" value="ok" />
	<input type="hidden" name="eb_seq" value="<?=$eb_seq?>" />
	<?php foreach ($paras as $k => $v) { ?><input type="hidden" name="<?=$k?>" value="<?=$v?>" /><?php } ?>
	</form>

</div>

</div>



</section>
